package x10.server;

import java.util.ArrayList;
import java.util.HashMap;

import x10.event.X10Event;

/**
 *
 * @author Denny
 */
public class X10DeviceTrackingQueue {
    private HashMap<String, X10Event> devices = new HashMap<String, X10Event>();

    public X10DeviceTrackingQueue(){
    }

    public void enQueue(X10Event device){
        devices.put(device.getAddress(), device);
    }

    public void deQueue(String deviceAddress){
        devices.remove(deviceAddress);
    }

    public X10Event getDevice(String address){
        return devices.get(address);
    }

    public int getDeviceCount(){
        return devices.size();
    }

    public ArrayList<String> getDeviceIDs(){
        ArrayList<String> keys = new ArrayList<String>();
        for(String key: devices.keySet()){
            keys.add(key);
        }
        return keys;
    }

    public HashMap<String, X10Event> getDevices(){
        return devices;
    }
}
